import 'dart:ffi';

import 'package:plugin_platform_interface/plugin_platform_interface.dart';

import 'esc_command.dart';
import 'flutter_gprinter.dart';
import 'flutter_gprinter_method_channel.dart';

abstract class FlutterGprinterPlatform extends PlatformInterface {
  /// Constructs a FlutterGprinterPlatform.
  FlutterGprinterPlatform() : super(token: _token);

  static final Object _token = Object();

  static FlutterGprinterPlatform _instance = MethodChannelFlutterGprinter();

  /// The default instance of [FlutterGprinterPlatform] to use.
  ///
  /// Defaults to [MethodChannelFlutterGprinter].
  static FlutterGprinterPlatform get instance => _instance;

  /// Platform-specific implementations should set this with their own
  /// platform-specific class that extends [FlutterGprinterPlatform] when
  /// they register themselves.
  static set instance(FlutterGprinterPlatform instance) {
    PlatformInterface.verifyToken(instance, _token);
    _instance = instance;
  }

  Future<String?> getPlatformVersion() {
    throw UnimplementedError('platformVersion() has not been implemented.');
  }

  void addMethodCallHandler(CallHandler handler) {
    throw UnimplementedError('addMethodCallHandler() has not been implemented.');
  }

  void navUsbDevices() {
    throw UnimplementedError('navUsbDevices() has not been implemented.');
  }

  void navBTDevices() {
    throw UnimplementedError('navBTDevices() has not been implemented.');
  }

  void navWifiDevices() {
    throw UnimplementedError('navWifiDevices() has not been implemented.');
  }

  void autoConnect() {
    throw UnimplementedError('autoConnect() has not been implemented.');
  }

  void connectUSB(String pathName) {
    throw UnimplementedError('connectUSB() has not been implemented.');
  }

  void connectNet(String ipAddress) {
    throw UnimplementedError('connectNet() has not been implemented.');
  }

  void connectBt(String macAddress) {
    throw UnimplementedError('connectBt() has not been implemented.');
  }

  void disconnect() {
    throw UnimplementedError('disconnect() has not been implemented.');
  }

  Future<bool> write(List<int> bytes) {
    throw UnimplementedError('write() has not been implemented.');
  }
}
